{template "content","header"}
<div class="ui-header">
		<a href="{APP_PATH}" id="icoback" class="header-btn left-pos">返回</a>
		<h1 class="ui-title">爱车盟</h1>
	</div>
	<div id="wrapper">
		<div class="clear" style="margin-top:30px;">
			<form class="ui-form ui-form-large" id="loginform" name="loginform" method="post" action="" style="display:block;width:80%;margin:0 auto;">
				<fieldset>
					<ul class="listform">
						<li class="">
							<span class="add-on">手机号：</span><input type="text" name="mobile" id="mobile" value="" size=""  title="此服务免费,验证码将以短信免费发送到您的手机">
					   </li>
					   <li class="" style="border:none">
							<span class="add-on">验证码：</span><input class="" name="code" type="text" value="" size="">
					   </li>
				   </ul>
				<div id="mobile_div"><div class="submit"><button onclick="get_verify()" type="button" class="btn">获取短信验证码</button></div> 
		
			</div>
			<div id="mobile_send_div" style="display:none">
				<div class="submit"><button type="button" id="GetVerify" onclick="get_verify()" class="btn">重获短信验证码</button></div>
			</div> 
			<script language="JavaScript">
			<!--
				var times = 90;
				var isinerval;
				function get_verify() {
					var mobile = $("#mobile").val();
					var partten = /^1[3-9]\d{9}$/;
					if(!partten.test(mobile)){
						alert("请输入正确的手机号码");
						return false;
					}
					$.get("api.php?op=sms",{ mobile: mobile,random:Math.random()}, function(data){
						if(data=="0") {
							//alert("短信接口未开通,当前验证码暂时为1234");
							$("#mobile_send").html(mobile);
							$("#mobile_div").css("display","none");
							$("#mobile_send_div").css("display","");
							times = 90;
							$("#GetVerify").attr("disabled", true);
							isinerval = setInterval("CountDown()", 1000);
						} else if(data=="-1") {
							alert("你今天获取验证码次数已达到上限");
						} else {
							alert("短信发送失败");
						}
					});
					
				}
				function CountDown() {
					if (times < 1) {
						$("#GetVerify").html("获取短信验证码").attr("disabled", false);
						$("#edit_mobile").css("display","");
						clearInterval(isinerval);
						return;
					}
					$("#GetVerify").html(times+"秒后重获验证码");
					times--;
				}
				function edit_mobile() {
					$("#mobile_div").css("display","");
					$("#mobile_send_div").css("display","none");
				}
			//-->
			</script>
			 <input type="hidden" name="wxid"  value="{$wxid}"> 
			 <input type="hidden" name="shopid"  value="{$shopid}"> 
				   <input type="submit" name="dologin" class="btn btn-warning show" style="width:100%;margin:25px auto 10px;height:35px" value="登录"> 
				</fieldset>
			</form>
		</div>
		</div><!-- /wrapper -->
{template "content","footer"}